extends "../mycorebase/mycorebase.gd"

var cnt
var cnt2
var cnt3
var flag1 = 0
var flag2 = 0

func init():
	.init()
	name = "时间核心"
	resetdata()
	att.atk = 10
	att.cd = 0.15
	info = "时间加速：每五秒使随机一个技能的冷却时间减少0.4s[当技能剩余冷却时间低于1.5s时不起效]\n"

func _connect():
	._connect()
	masCha.connect("onBattleStart",self,"resetcnt")

#重置计数
func resetcnt():
	cnt = 0
	cnt2 = 0
	cnt3 = 0
	flag1 = 0
	flag2 = 0

#时间加速
func _upS():
	._upS()
	cnt += 1
	if cnt == 5:
		cnt = 0
		var skills = masCha.skills
		var sk = sys.rndListItem(skills)
		if sk.cd - sk.nowTime <= 1.5:return
		sk.nowTime += 0.4
